<template>
  <div class="transition">
    <el-button name="btn" @click="handleShow">显示/隐藏</el-button>
    <transition name="fade">
      <p v-if="show">giao</p>
    </transition>
  </div>
</template>

<script>
export default {
  data() {
    return {
      show: true,
    };
  },
  methods: {
    handleShow(e) {
      //   this.show = !this.show;
      console.log(e.target.name);
    },
  },
};
</script>

<style lang="less" scoped>
.transition {
  width: 100%;
}
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  opacity: 0;
}
</style>
